//
//  FFDemuxer.hpp
//  VideoParse
//
//  Created by xiaerfei on 2020/4/1.
//  Copyright © 2020 erfeixia. All rights reserved.
//

#ifndef FFDemuxer_hpp
#define FFDemuxer_hpp

#include <stdio.h>
#include "rational.hpp"

class FFDemuxer {
    
public:
    char *name;
    char *long_name;
    int missing_streams;
    int sum_flv_tag_size;
    
    int trust_metadata;   ///< configure streams according onMetaData
    int trust_datasize;   ///< trust data size of FLVTag
    int last_keyframe_stream_index;
    int keyframe_count;
    int64_t video_bit_rate;
    int64_t audio_bit_rate;
    int64_t *keyframe_times;
    int64_t *keyframe_filepositions;
    
    AVRational framerate;
    
    struct {
        int64_t dts;
        int64_t pos;
    } validate_index[2];
    int validate_next;
    int validate_count;
    
    virtual int read_header(void *s);
    virtual int read_packet(void *s, void *pkt);
    virtual int read_seek(void *s, int stream_index, int64_t ts, int flags);
    virtual int read_close(void *s);
    
    
};



#endif /* FFDemuxer_hpp */
